package com.vue.controller;

import com.vue.service.DeepSeekService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.Map;

/**
 * @author: wrj
 * @since: 2025/2/12 09:41
 * @description:
 */
@RestController
@RequestMapping("deepSeek")
public class DeepSeekController {

    @Autowired
    private DeepSeekService aiService;

    @PostMapping("/chat")
    public ResponseEntity<Map<String, String>> chat(@RequestBody Map<String, String> request) {
        String userMessage = request.get("message");
        String response = aiService.send(userMessage);
        return ResponseEntity.ok().body(Collections.singletonMap("response", response));
    }
}